/**
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2010  Sean Beecroft

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

 * @version 1.10 2010-01-01
 * @author Sean Beecroft
 */
package yawiki.server.application;

import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Tracker extends HttpServlet {

    /** Demonstration program to call the Google Web APIs service.
     ** Usage:<br>
     **   <tt>java com.google.soap.search.GoogleAPIDemo [key] search Foo</tt><br>
     **   <tt>java com.google.soap.search.GoogleAPIDemo [key] cached http://www.google.com/</tt>
     **   <tt>java com.google.soap.search.GoogleAPIDemo [key] spell "britnay spars"</tt>
     **/
    public void doGet(HttpServletRequest request,
            HttpServletResponse response)
            throws IOException, ServletException {

        String ref = request.getParameter("ref"); //"this is a big test";
        String title = request.getParameter("title");
        String ad = request.getParameter("ad");

        FileOutputStream fos = new FileOutputStream(new File("./test.data"));
        PrintWriter writer = new PrintWriter(fos);
        writer.println("ref=" + ref + "&title=" + title + "&ad=" + ad);
        writer.flush();
        writer.close();

    }

    public void doPost(HttpServletRequest request,
            HttpServletResponse response)
            throws IOException, ServletException {
        doGet(request, response);
    }
}
